import {createRouter, createWebHistory} from 'vue-router'

// 创建router路由对象
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      name: 'Index',
      path: '/',
      redirect: '/user/index'
    },
    {
      name: "UserIndex",
      path: "/user/index",
      component: () => import('@/views/user/Index.vue')
    },
    {
      name: "UserEdit",
      path: "/user/edit/:id",
      component: () => import('@/views/user/Edit.vue')
    }
  ],
  scrollBehavior() {
    return{
      left: 0,
      top: 0
    }
  }
})

export default router
